package com.javafactroy.kunlong.test.db;


import com.github.jsonzou.jmockdata.MockConfig;
import com.javafactroy.kunlong.DbAgent;
import com.javafactroy.kunlong.base.annotation.CheckParams;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.sql.*;

@SpringBootTest(classes = {DbAgent.class}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ExtendWith(SpringExtension.class)
@Slf4j
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@TestMethodOrder(MethodOrderer.MethodName.class)

public class TestPostgres {



    @CheckParams
    @Test
    public void test001_hubQuery() throws SQLException {

    }

    @Test
    public void test002_empQuery() throws SQLException {

    }

    @Test
    public void test003_mockDataDecimal() {
        MockConfig mockConfig = new MockConfig()
                .doubleRange(1e-9, 1111222221119999.99999d)
                .floatRange(1e-8f, 111111122221119999.99999f)
                .decimalScale(52).excludes("orderBys") // 设置小数位数为3，默认是2
                .globalConfig();

    }


    @Test
    public void test004_qry() {

    }
}
